package com.lj.frame.menu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ApiModel()
@Data
public class Menu {
    @ApiModelProperty(name = "菜单ID", required = true)
    @TableId(type = IdType.INPUT)
    private Integer id;
    @ApiModelProperty(name = "菜单父ID")
    private Integer pid = 0;
    @ApiModelProperty(name = "名称", required = true)
    @NotEmpty(message = "名称不可为空")
    private String name;
    @ApiModelProperty(name = "路径", required = true)
    private String path;
    @ApiModelProperty(name = "布局")
    private String layout;
    @ApiModelProperty(name = "是否链接")
    private Boolean isLink = false;
    @ApiModelProperty(name = "自定义样式")
    private String css;
    @ApiModelProperty(name = "排序")
    private Integer sort = 0;
    @ApiModelProperty(name = "是否为菜单")
    private Boolean isMenu = true;
    @ApiModelProperty(name = "是否展示")
    private Boolean isDisplay = true;
    @ApiModelProperty(name = "创建时间")
    private Date createTime = new Date();

    @ApiModelProperty(name = "子菜单集合")
    @TableField(exist = false)
    private List<Menu> child = new ArrayList<>();


}
